home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-02-23 | 1.8 KB | 52 lines | [TEXT/GEOL] |
- Item forwarded by A33 to A34
-
- Item 0438286 17-Feb-90 03:06PST
-
- From: D5295 Reseach SW Design, D Goldman,PRT
-
- To: MACAPP.TECH$ MacApp Technical
-
- cc: MADA2 MacApp Dev Assoc, Curtis Faith,IVC
-
- Sub: Re: TTEView Question
-
- John --
-
- Thanks for pointing this out. I just recently wrote some methods which do a
- bunch of StuffTexts, and completely overlooked the fFreeText field. Based on a
- quick glance at StuffText (I didn't even look at TTEView.Free), I just assumed
- that StuffText was disposing its old hText/fText every time! So my code looks
- like:
-
- aHandle := handleToTheNewValue;
- FailOSErr(HandToHand(aHandle));
- StuffText(aHandle);
-
- This way I can dispose handleToTheNewValue whenever I feel like it, and TTEView
- can dispose hText/fText whenever IT feels like it. (At least it could if I also
- set fFreeText!)
-
- Couldn't we get rid of fFreeText, fSavedTEHandle, and this entire discussion
- simply by having StuffText ALWAYS do the following:
-
- 1) DisposIfHandle(fText);
-
- 2) localHandle := theText;
- FailOSErr(HandToHand(localHandle));
-
- 3) assign hText, fText, etc using localHandle ?
-
- True, we will always have two copies of the new text (my handleToTheNewValue
- and TTEView's fText/hText) taking up memory, but on the other hand we've
- eliminated fSavedTEHandle. So we come out even, right? Moreover, I can dispose
- handleToTheNewValue immediately after calling StuffText, if I like.
-
- This seems much less kludgy than the deal with fFreeText and fSavedTEHandle. Am
- I missing something obvious?
-
- -- Dave Goldman, D5295
- Research Software Design
- (Still not on MacApp.Tech$, for anyone who wants me to see their reply
- before 2/23/90)
-
-